# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=kmailtransport
pkgver=22.04.3
pkgrel=0
pkgdesc="Manage mail transport"
# armhf blocked by extra-cmake-modules
# ppc64le and s390x blocked by libkgapi
arch="all !armhf !ppc64le !s390x !riscv64"
url="https://kontact.kde.org/"
license="LGPL-2.0-or-later"
depends_dev="
	akonadi-dev
	akonadi-mime-dev
	kcmutils-dev
	kconfigwidgets-dev
	ki18n-dev
	kio-dev
	kmime-dev
	ksmtp-dev
	kwallet-dev
	libkgapi-dev
	qt5-qtkeychain-dev
	"
makedepends="$depends_dev
	extra-cmake-modules
	samurai
	"
checkdepends="xvfb-run"
source="https://download.kde.org/stable/release-service/$pkgver/src/kmailtransport-$pkgver.tar.xz"
subpackages="$pkgname-dev $pkgname-lang"
options="!check" # Requires OpenGL and running dbus

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib
	cmake --build build
}

check() {
	cd build
	CTEST_OUTPUT_ON_FAILURE=TRUE xvfb-run ctest
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
2287519dcd91c696ec2a7cf17d2c535b687f06e6f39a69050da64aa1ac534bd0b81e59b740613695e426415a22cb418f60a73a9b713fa6a4f66b96270dca498f  kmailtransport-22.04.3.tar.xz
"
